/*******************************************************************************
* Project: QSAR(Cute Software Architecture) 
*
* Copyright: Copyright(C) 2024 by YuetingBen, All Rights Reserved
*
* File name: MemAcc.c
*
* Brief: ;
*
* Author: Yueting.Ben
*
* Module: MemAcc
*
*******************************************************************************/

/** HEADER FILES **/
#include "MemAcc.h"


/** MACRO DEFINITION **/


/** TYPEDEF DEFINITION **/


/** LOCAL DATA DECLARATION **/


/** GLOBAL DATA DECLARATION **/


/** LOCAL FUNCTION DECLARATION **/


/** GLOBAL FUNCTION DECLARATION **/
void MemAcc_GetVersionInfo(
    Std_VersionInfoType* versionInfo
);


/** LOCAL DATA **/


/** GLOBAL DATA **/


/** LOCAL FUNCTION **/


/** GLOBAL FUNCTION **/

/*******************************************************************************
* -Name            MemAcc_GetVersionInfo
* -Brief           Returns the version information of this module 
* -Details         None
* -Param[out]      versioninfo: Pointer to the version information of this module
* -Return          None          
*******************************************************************************/
void MemAcc_GetVersionInfo(
    Std_VersionInfoType* versionInfo
)
{
    versionInfo->vendorID = (uint16)YSAR_VENDOR_ID;
    versionInfo->moduleID = (uint8)MEMACC_MODULE_ID;
    versionInfo->sw_major_version = (uint8)MEMACC_SW_MAJOR_VERSION;
    versionInfo->sw_minor_version = (uint8)MEMACC_SW_MINOR_VERSION;
    versionInfo->sw_patch_version = (uint8)MEMACC_SW_PATCH_VERSION;
}

/*******************************************************************************
* -Name            MemAcc_Read
* -Brief           Triggers a read job to copy data from the source address into the referenced destination data buffer 
* -Details         None
* -Param[in]       addressAreaId: Numeric identifier of address area
* -Param[in]       sourceAddress: Read address in logical address space
* -Param[in]       length: Read length in bytes(aligned to read page size)
* -Param[out]      destinationDataPtr: Destination memory pointer to store the read data
* -Return          E_OK: The requested job has been accepted by the module
                   E_NOT_OK: The requested job has not been accepted by the module
                   E_MEM_SERVICE_NOT_AVAIL: The underlying Mem driver service function is not available
*******************************************************************************/
Std_ReturnType MemAcc_Read(
    MemAcc_AddressAreaIdType addressAreaId,
    MemAcc_AddressType sourceAddress,
    MemAcc_DataType* destinationDataPtr,
    MemAcc_LengthType length
)
{
    Mem_Read(addressAreaId, sourceAddress, destinationDataPtr,length);
}

/*******************************************************************************
* -Name            MemAcc_Write
* -Brief           Triggers a write job to store the passed data to the provided address area with given address and length 
* -Details         None
* -Param[in]       addressAreaId: Numeric identifier of address area
* -Param[in]       targetAddress: Write address in logical address space
* -Param[in]       sourceDataPtr: Source data pointer
* -Param[in]       length: Write length in bytes (aligned to page size)
* -Return          E_OK: The requested job has been accepted by the module
                   E_NOT_OK: The requested job has not been accepted by the module
                   E_MEM_SERVICE_NOT_AVAIL: The underlying Mem driver service function is not available
*******************************************************************************/
Std_ReturnType MemAcc_Write(
    MemAcc_AddressAreaIdType addressAreaId,
    MemAcc_AddressType targetAddress,
    const MemAcc_DataType* sourceDataPtr,
    MemAcc_LengthType length
)
{
    Mem_Write(addressAreaId, targetAddress, sourceDataPtr, length);
}

/*******************************************************************************
* -Name            MemAcc_Erase
* -Brief           Triggers an erase job of the given area 
* -Details         None
* -Param[in]       addressAreaId: Numeric identifier of address area
* -Param[in]       targetAddress: Erase address in logical address space (aligned to sector size).
* -Param[in]       sourceDataPtr: Source data pointer
* -Param[in]       length: Erase length in bytes(aligned to sector size).
* -Return          E_OK: The requested job has been accepted by the module
                   E_NOT_OK: The requested job has not been accepted by the module
                   E_MEM_SERVICE_NOT_AVAIL: The underlying Mem driver service function is not available
*******************************************************************************/
Std_ReturnType MemAcc_Erase(
    MemAcc_AddressAreaIdType addressAreaId,
    MemAcc_AddressType targetAddress,
    MemAcc_LengthType length
)
{
    
}


